﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Topcoder
{
    namespace SRM536
    {
        class BinaryPolynomialDivTwo
        {
            public static int countRoots(int[] a)
            {
                int num1 = 0;
                for (int i = 0; i < a.Length; i++)
                {
                    if (a[i] == 1) num1++;
                }
                if (a[0] == 0) return 2;
                else
                {
                    if (num1 % 2 == 1) return 0;
                    else return 1;
                    
                }

            }
        }
    }
}
